<?php 

	$tour_name    		 = $this->Item['name'];
	$options      		 = array('Inactive','Active');
	$status       		 = $options[$this->Item['status']];
	
	$order        		 = $this->Item['order'];
	
	$options      		 = array('Khách đoàn', 'Khách lẻ');
	$type         		 = $options[$this->Item['type']];
	
	$cost                = $this->Item['cost'];
	if(empty($cost)) {
		$cost = 'Liên Hệ';
	}else {
		$cost = $cost . '.000 VNĐ';
	}
	
	$locate_start 		 = $this->Item['location_start'];

	$locate_end   		 = $this->Item['location_end'];
	
	$time_limit   		 = $this->Item['time_limit'];
	
	$time_available      = $this->Item['time_available'];
	
	$options      		 = $this->categorySelect;
	$category      		 = $options[$this->Item['tour_category_id']];
	
	$options             = $this->contactSelect;
	$contact             = $options[$this->Item['contact'][0]['id']];
	
	$date_start_apply    = $this->Item['time_start_apply'];
	
	$date_end_apply      = $this->Item['time_end_apply'];
	
	$date_start_register = $this->Item['time_start_register'];
	
	$date_end_register   = $this->Item['time_end_register'];
	
	$image               = $this->Item['image'];
	
	$medium              = $this->Item['medium'];
	
	$hotel               = $this->Item['hotel_iso'];
	
	$timetable           = unserialize($this->Item['timetable']);
	
	$notice              = unserialize($this->Item['notice']);
	
	$created             = $this->Item['created'];
	
	$created_by          = $this->Item['created_by'];
	
	$modified            = $this->Item['modified'];
	
	$modified_by         = $this->Item['modified_by'];
	
	$view                = $this->Item['view'];
	
	$description         = $this->Item['description'];
	
	$timetableIcon       = '<a href = "#" onclick = "changeDisplay(\'timetable\')">
	                            <img src = "' . $this->imgUrl . '/icon/arrow_up.png" id = "timetableImg">
	                            Time table
	                        </a>';
	
	$noticeIcon          = '<a href = "#" onclick = "changeDisplay(\'notice\')">
								<img src = "' . $this->imgUrl . '/icon/arrow_up.png" id = "noticeImg">
	                            Notice
	                        </a>';
	
	$descriptionIcon     = '<a href = "#" onclick = "changeDisplay(\'description\')">
								<img src = "' . $this->imgUrl . '/icon/arrow_up.png" id = "descriptionImg">
								Description
	                        </a>';
	
	// form errors
	if(count($this->messageError)>0){
		$errors = $this->formErrors($this->messageError,array('id'=>'errors'));
	}
?>
<script type="text/javascript">
    function changeDisplay(id){
       var imgLink = $('#' + id + 'Img').attr('src');
       if(imgLink == '/sunny/public/templates/admin/main/images/icon/arrow_up.png') {
    	   imgLink = '/sunny/public/templates/admin/main/images/icon/arrow_down.png';
       }else {
    	   imgLink = '/sunny/public/templates/admin/main/images/icon/arrow_up.png';
       }
       $('div#' + id + 'info').slideToggle();
       $('#' + id + 'Img').attr("src",imgLink);
    } 
</script>

<form id = 'appForm' name="appForm" method="post" action="" enctype="multipart/form-data">



                        <?php echo $this->render('admin-tour-category/toolbar/index.php')?>
                        <div class="clr"></div>
                         <?php echo $this->render('admin-tour-category/sublink/index.php')?>
                         <?php echo $errors?>
                        <!-- BEGIN: CONTENT -->
                        <div id="element-box">
                            <div class="t">
                                <div class="t">
                                    <div class="t"></div>
                                </div>
                            </div>
                            <div class="m">
                                <!-- BEGIN: ELEMENT BOX -->
						<div id="adminfieldset">
                             <div class="adminheader">Detail</div>
                             <div id = 'adminfieldsetcontent' >
						     <div id = 'adminfieldsetleft'>
						     
						      <div id="row">
                                    <div class="label">Image:</div>
                                    <img src = "<?php echo $this->fileUrl . '/tour_picture/large/' . $image; ?>" width = "130" height = "110">
                                 </div>
                                <div class="clr"></div>
						     
								<div id="row">
                                    <div class="label">Tour name:</div>
                                    <?php echo $tour_name;?>			
                                </div>
                                <div class="clr"></div>
                                                      
                                 <div id="row">
                                    <div class="label">Time limit:</div>
                                    <?php echo $time_limit;?>			
                                </div>
                                <div class="clr"></div>
                                
                                 <div id="row">
                                    <div class="label">Time available:</div>
                                    <?php echo $time_available;?>			
                                </div>
                                <div class="clr"></div>
                                
                                  <div id="row">
                                    <div class="label">Medium:</div>
                                    <?php echo $medium;?>			
                                </div>
                                <div class="clr"></div>
                                
                                <div id="row">
                                    <div class="label">Hotel:</div>
                                    <?php echo $hotel . ' Sao';?>			
                                </div>
                                <div class="clr"></div>
                                
                                <div id="row">
                                    <div class="label"> Cost:</div>
                                    <?php echo $cost;?>			
                                </div>
                                <div class="clr"></div>
                                
                                <div id="row">
                                    <div class="label">Ordering:</div>
                                    <?php echo $order;?>			
                                </div>
                                <div class="clr"></div>
                                
                                 <div id="row">
                                    <div class="label">Status:</div>
                                    <?php echo $status;?>			
                                </div>
                                <div class="clr"></div>
                                
                                 <div id="row">
                                    <div class="label">Type:</div>
                                    <?php echo $type;?>			
                                </div>
                                <div class="clr"></div>
                                
                                 <div id="row">
                                    <div class="label">Location start:</div>
                                    <?php echo $locate_start;?>			
                                </div>
                                <div class="clr"></div>
                                
                                 <div id="row">
                                    <div class="label">Location end:</div>
                                    <?php echo $locate_end;?>			
                                </div>
                                <div class="clr"></div>
                                
                                 <div id="row">
                                    <div class="label">Category:</div>
                                    <?php echo $category;?>			
                                </div>
                                
                                <div id="row">
                                    <div class="label">Contact:</div>
                                    <?php echo $contact;?>			
                                </div>
                                
                                <div class="clr"></div>
                                
                                <div id="row">
                                    <div class="label">Date start apply:</div>
                                    <?php echo $date_start_apply;?>			
                                </div>
                                <div class="clr"></div>
                                
                                  <div id="row">
                                    <div class="label">Date end apply:</div>
                                    <?php echo $date_end_apply;?>			
                                </div>
                                <div class="clr"></div>
                                
                                  <div id="row">
                                    <div class="label">Date start register:</div>
                                    <?php echo $date_start_register;?>			
                                </div>
                                <div class="clr"></div>
                                
                                <div id="row">
                                    <div class="label">Date end register:</div>
                                    <?php echo $date_end_register;?>			
                                </div>
                                <div class="clr"></div>
                                
                                 <div id="row">
                                    <div class="label">Created:</div>
                                    <?php echo $created;?>			
                                </div>
                                <div class="clr"></div>
                                
                                 <div id="row">
                                    <div class="label">Created_by:</div>
                                    <?php echo $created_by;?>			
                                </div>
                                <div class="clr"></div>
                                
                                 <div id="row">
                                    <div class="label">Modified:</div>
                                    <?php echo $modified;?>			
                                </div>
                                <div class="clr"></div>
                                
                                 <div id="row">
                                    <div class="label">Modified_by:</div>
                                    <?php echo $modified_by;?>			
                                </div>
                                <div class="clr"></div>
                                
                                 <div id="row">
                                    <div class="label">View:</div>
                                    <?php echo $view;?>			
                                </div>
                                <div class="clr"></div>
                                
                              </div>
                              <div id = 'adminfieldsetright'>
                              <div class = 'tetra' id = "timetable">
                              <div class="adminheader"><?php echo $timetableIcon; ?></div>
	                               <div id = "timetableinfo" style="display: none">
	                               
	                               <?php 
	                                   if(!empty($timetable)) {
	                                       foreach ($timetable as $key => $value) {
	                                       	
                                   ?>
	                                       <div id="row">
	                                       	<div class="label" style="width: auto"><?php echo $value['title']; ?></div>
	                                        </div>
	                                         <div class="clr"></div>
	                                         
	                                         <div id="row" style="border-bottom: 1px solid #CCCCCC; text-align: justify">
	                                            <?php echo $value['content'];?>
	                                        </div>
	                                        <div class="clr"></div>
	                               <?php 
	                                       }
	                                   }
	                               ?>
	                               
                                </div>
                              </div>
                              <br>
                              
                              <div class = 'tetra' id = "notice">
                               <div class="adminheader"><?php  echo $noticeIcon; ?></div>
	                                <div id = 'noticeinfo' style="display: none">
	                                 <?php 
	                                   if(!empty($notice)) {
	                                       foreach ($notice as $key => $value) {
	                                       	
                                   ?>
	                                       <div id="row">
	                                       	<div class="label" style="width: auto"><?php echo $value['title']; ?></div>
	                                        </div>
	                                         <div class="clr"></div>
	                                         
	                                         <div id="row" style="border-bottom: 1px solid #CCCCCC; text-align: justify">
	                                            <?php echo $value['content'];?>
	                                        </div>
	                                        <div class="clr"></div>
	                               <?php 
	                                       }
	                                   }
	                               ?>
                                
                               </div>
                              </div>
                              
                              <br>
                              
                              <div class = 'tetra' id = "description">
                               <div class="adminheader"><?php  echo $descriptionIcon; ?></div>
	                                <div id = 'descriptioninfo' style="display: none">
	                                  <div id="row" style=" text-align: justify">
	                                       <?php echo $this->Item['description'];?>
	                                   </div>
	                               </div>
                              </div>
                              
                              </div> 
                              </div> 
                              <div class="clr"></div> 
							</div>
							
                                <!-- END: ELEMENT BOX -->	
                              <div class="clr"></div>
                            </div>
                            <div class="b">
                                <div class="b">
                                    <div class="b"></div>
                                </div>
                            </div>
                        </div>
                        <!-- END: 	CONTENT -->
                        
                        <div id = 'data'></div>
                    </form>